// 渠道管理
import axios from '@/utils/request';

// 渠道配置 - 列表
export const getChannelList = (params) => {
  return axios.get('/web/channel/list', {
    params,
  });
};

// 渠道配置 - 列表 - 生成code
export const createChannelList = () => {
  return axios.post('/web/channel/createSign');
};

// 渠道配置 - 列表 - 新增
export const addChannelList = (params) => {
  return axios.post('/web/channel/add', {
    ...params,
  });
};

// 渠道配置 - 列表 - 编辑
export const editChannelList = (params) => {
  return axios.post('/web/channel/edit', {
    ...params,
  });
};

// 渠道配置 - 列表 - 配置表单 - list
export const getConfigChannelList = (params) => {
  return axios.get('/web/channel/element/list', {
    params,
  });
};

// 渠道配置 - 列表 - 配置表单 - 配置
export const configChannelList = (params) => {
  return axios.post('/web/channel/element/save', {
    ...params,
  });
};

// 渠道配置 - 列表 - 渠道下拉
export const getChannelSelect = (params) => {
  return axios.get('/web/channel/list/type', {
    params,
  });
};

// 任务大厅 - 列表
export const getInfoFlowList = (params) => {
  return axios.get('/shop/api/merchantTask/list', {
    params,
  });
};

//选品大厅 - 列表
export const getGoodsList = (params) => {
  return axios.get('/shop/api/goods/goods/goodsList', {
    params,
  });
};



// 任务大厅 - 列表 - 分类
export const getCategoryTree = (params) => {
  return axios.get('/shop/api/goods/goods/categoryTree', {
    params,
  });
};

// 任务大厅 - 列表 - 详情
export const merchantTaskInfo = (params) => {
  return axios.get("/shop/api/merchantTask/info", {
    params,
  });
};

//任务领取计算
export const receiveEstimate = (params) => {
  return axios.post('/shop/api/merchantTask/receiveEstimate', {
    ...params,
  });
};

//任务领取
export const receiveTask = (params) => {
  return axios.post('/shop/api/merchantTask/receive', {
    ...params,
  });
};
//获取达人列表
export const customersList = (params) => {
  return axios.get("/shop/api/kuaishou/customers/list", {
    params,
  });
};

//获取达人地址
export const address = (params) => {
  return axios.get("/shop/api/user/address", {
    params,
  });
};

//新增地址
export const add_address = (params) => {
  return axios.post('/shop/api/user/address', {
    ...params,
  });
};

//申请专属任务
export const taskApply = (params) => {
  return axios.post('/shop/api/dedicatedTaskApply/apply', {
    ...params,
  });
};





//获取商品详情
export const goodsList = (id, params) => {
  return axios.get(`/shop/api/goods/goods/${id}`, {
    params,
  });
};

//任务申样
export const samplesAdd = (params) => {
  return axios.post('/shop/api/kuaishou/samples/add', {
    ...params,
  });
};

//获取我的任务
export const myList = (params) => {
  return axios.get(`/shop/api/merchantTask/myList`, {
    params,
  });
};




// 产品下拉
export const getProductSelect = (params) => {
  return axios.get('/web/loan/get/loan/product/by/type', {
    params,
  });
};
// 渠道API进件统计 - 列表
export const getApiList = (params) => {
  return axios.get('/web/channel/api/statistics', {
    params,
  });
};

// 渠道用户 - 列表
export const getUserList = (params) => {
  return axios.get('/web/channel/phone/channel/source/list', {
    params,
  });
};
export const loanlist = (params) => {
  return axios.get('/web/channel/loan/list', {
    params,
  });
};
// 渠道用户 - 列表
export const institutionlist = (params) => {
  return axios.get('/web/channel/institution/list', {
    params,
  });
};
// 机构筛 - 列表
export const institutionlistname = (params) => {
  return axios.get('/web/institution/list/name', {
    params,
  });
};
export const institutionlistsum = (params) => {
  return axios.get('/web/channel/institution/list/sum', {
    params,
  });
};
export const loanlistsum = (params) => {
  return axios.get('/web/channel/loan/list/sum', {
    params,
  });
};
